#include"conio.h"
#include"stdio.h"
#include"stdlib.h"
float luong(float h, float d, float g, float q);
int main()
{
   clrscr();
   float h,d,g,q;
   printf("Nhap he so h=");
   scanf("%f",&h);
   printf("Nhap don gia d=");
   scanf("%f",&d);
   printf("Nhap so gio lam trong thang g=");
   scanf("%f",&g);
   printf("Nhap so gio lam qui dinh q=");
   scanf("%f",&q);
   printf("Tien luong= %0.2f", luong(h,d,g,q));
   getch();
   return 0;
}
float luong(float h, float d, float g, float q)
{
   float sum;
   if(g<=q) sum=h*d*g;
   else sum=h*d*q + h*d*(g-q)/2;
   return sum;
}


